<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function MaxGrow(nums){
      if(nums.length === 0) return 0
      //初始化
      let f = new Array(nums.length).fill(1)
      // 状态转换方程

      for(let i = 1; i < nums.length; i++){
        if(nums[i] > nums[i - 1]){
          f[i] = f[i - 1] + 1
        }else {
          f[i] = f[i - 1]
        }
      }
      return f.sort()[f.length - 1]
    }
    let nums = [5,4,1,2,3]
    console.log(MaxGrow(nums))
  </script>
</body>
</html>